package love.yuanmengrobot.als.system.servlet;

import love.yuanmengrobot.als.system.dao.impl.MainPageContentDaoImpl;
import love.yuanmengrobot.als.system.javaBean.Alsannouncement;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public class mainPageContentServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        MainPageContentDaoImpl mainPageContentDao=new MainPageContentDaoImpl();
      List<Alsannouncement> announcement=  mainPageContentDao.selectAllAnnouncement();


        request.setAttribute("announcement", announcement);
        request.getRequestDispatcher("WEB-INF/view/system/main/mainPageContent.jsp").forward(request, response);
    }
}
